//
//  RWReminderDetailModel.m
//  Chat
//
//  Created by 任伟 on 16/3/8.
//  Copyright © 2016年 任伟. All rights reserved.
//

#import "RWReminderDetailModel.h"

@implementation RWReminderDetailModel

-(instancetype)initWithSelf:(RWReminderDetailModel *)model_{
    if (self = [super init]) {
        self.id = model_.id;
        self.firstDate = model_.firstDate;
        self.date = model_.date;
        self.ringName = [model_.ringName mutableCopy];
        self.repeat = [model_.repeat mutableCopy];
        self.repeatCustom = [model_.repeatCustom mutableCopy];
        self.ahead = [model_.ahead mutableCopy];
        self.reminderType = [model_.reminderType mutableCopy];
        self.explain = [model_.explain mutableCopy];
        self.isNotication = model_.isNotication;
        self.firstDate = [model_.firstDate mutableCopy];
        self.id = [model_.id mutableCopy];
        self.countDownSec = model_.countDownSec;
        self.runStatus = model_.runStatus;
    }
    return self;
}

-(void)setData:(RWReminderDetailModel *)model_{
    self.id = model_.id;
    self.firstDate = model_.firstDate;
    self.date = model_.date;
    self.ringName = [model_.ringName mutableCopy];
    self.repeat = [model_.repeat mutableCopy];
    self.repeatCustom = [model_.repeatCustom mutableCopy];
    self.ahead = [model_.ahead mutableCopy];
    self.reminderType = [model_.reminderType mutableCopy];
    self.explain = [model_.explain mutableCopy];
    self.isNotication = model_.isNotication;
    self.firstDate = [model_.firstDate mutableCopy];
    self.id = [model_.id mutableCopy];
    self.countDownSec = [model_.countDownSec mutableCopy];
    self.runStatus = [model_.runStatus mutableCopy];
}

- (id)initWithCoder:(NSCoder *)decoder {
    self = [super init];
    if (!self) {
        return nil;
    }
    self.id = [decoder decodeObjectForKey:@"id"];
    self.firstDate = [decoder decodeObjectForKey:@"firstDate"];
    self.date = [decoder decodeObjectForKey:@"date"];
    self.ringName = [decoder decodeObjectForKey:@"ringName"];
    self.repeat = [decoder decodeObjectForKey:@"repeat"];
    self.repeat = [decoder decodeObjectForKey:@"repeatCustom"];
    self.ahead = [decoder decodeObjectForKey:@"ahead"];
    self.reminderType = [decoder decodeObjectForKey:@"reminderType"];
    self.explain = [decoder decodeObjectForKey:@"explain"];
    self.isNotication = [[decoder decodeObjectForKey:@"isNotication"] boolValue];
    self.firstDate = [decoder decodeObjectForKey:@"firstDate"];
    self.id = [decoder decodeObjectForKey:@"id"];
    self.countDownSec = [decoder decodeObjectForKey:@"countDownSec"];
    self.runStatus = [decoder decodeObjectForKey:@"runStatus"];
    
    return self;
}


- (void)encodeWithCoder:(NSCoder *)encoder {
    [encoder encodeObject:self.id forKey:@"id"];
    [encoder encodeObject:self.firstDate forKey:@"firstDate"];
    [encoder encodeObject:self.date forKey:@"date"];
    [encoder encodeObject:self.ringName forKey:@"ringName"];
    [encoder encodeObject:self.repeat forKey:@"repeat"];
    [encoder encodeObject:self.repeat forKey:@"repeatCustom"];
    [encoder encodeObject:self.ahead forKey:@"ahead"];
    [encoder encodeObject:self.reminderType forKey:@"reminderType"];
    [encoder encodeObject:self.explain forKey:@"explain"];
    [encoder encodeObject:[NSNumber numberWithBool:self.isNotication] forKey:@"isNotication"];
    [encoder encodeObject:self.firstDate forKey:@"firstDate"];
    [encoder encodeObject:self.id forKey:@"id"];
    [encoder encodeObject:self.countDownSec forKey:@"countDownSec"];
    [encoder encodeObject:self.runStatus forKey:@"runStatus"];
}

@end
